$(function () {
    // 粒子线条背景
    $(document).ready(function () {
        $('.layui-container').particleground({
            dotColor: '#7ec7fd',
            lineColor: '#7ec7fd'
        })
    })


    // 登录操作
    $(".layui-form").on("submit", function (e) {
        e.preventDefault()
        let a = $(this).serialize()
        $.ajax({
            type: "POST",
            url: "/api/login",
            data: a,
            success: function (res) {
                location.href = "/index.html"
                res.end({
                    "status": 0,
                    "message": "登录成功",
                    "token": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImlhdCI6MTU5NzkyOTI5NCwiZXhwIjoxNTk3OTMyODk0fQ.8dj-oRfr1LXJaujO6akGaoDZK4t10Gs46ICy1yQJYhs"
                })
            }
        })
    })

})